//
//  AXMyScDpTableViewCell.m
//  AnXin100
//
//  Created by 天质弘耕 on 2018/10/18.
//  Copyright © 2018年 tzhg. All rights reserved.
//

#import "AXMyScDpTableViewCell.h"
#import "UIView+SDAutoLayout.h"
#import "ZXCategories.h"
#import "UITableView+SDAutoTableViewCellHeight.h"

@implementation AXMyScDpTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self creatView];
        [self setlayout];
    }
    return self;
}


- (void)creatView {
    
    /** 用户图像 */
    self.userImageView = [[UIImageView alloc]init];
    self.userImageView.image = [UIImage imageNamed:@"xy.jpeg"];
    [self.contentView addSubview:self.userImageView];
    /** 店铺名字 */
    self.shopNameLabel = [[UILabel alloc]init];
    self.shopNameLabel.text = @"小猪佩奇店铺";
    self.shopNameLabel.font = FONT_FOURTEEN;;
    [self.contentView addSubview:self.shopNameLabel];
    
    self.starAppraiseView = [[ ZXSampleStarAppraiseView alloc]init];
    self.starAppraiseView.score = 5;
    [self.contentView addSubview:self.starAppraiseView];
    
}


- (void)setlayout {
    
    self.userImageView.sd_layout
    .leftSpaceToView(self.contentView, 10)
    .topSpaceToView(self.contentView, 10)
    .widthIs(50)
    .heightIs(50);
    
    self.shopNameLabel.sd_layout
    .leftSpaceToView(self.userImageView, 10)
    .topSpaceToView(self.contentView, 5)
    .rightSpaceToView(self.contentView, 10)
    .heightIs(30);
    
    self.starAppraiseView.sd_layout
    .leftSpaceToView(self.userImageView, 10)
    .topSpaceToView(self.shopNameLabel, 0)
    .widthIs(100)
    .heightIs(30);
    
    [self setupAutoHeightWithBottomView:self.starAppraiseView bottomMargin:10];
}

@end
